package com.example.tests;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import org.testng.annotations.Test;
import com.example.fw.ContactObjects;
import com.example.fw.Contacts;

public class AddEmptyContactTest extends TestBase {
	
	@Test
	public void testEmptyDataContactCanBeCreated() throws Exception {
		ContactObjects emptyDataContact = new ContactObjects()
			.setFirstname("")
			.setLastname("")
			.setAddress("")
			.setHome("")
			.setMobile("")
			.setWork("")
			.setEmail("")
			.setEmail2("")
			.setBday("-")
			.setBmonth("-")
			.setByear("")
			.setGroup("[none]")
			.setAddress2("")
			.setPhone2("");
		Contacts oldList = app.getContactHelper().getContacts();
		app.getContactHelper().createContact(emptyDataContact);
		Contacts newList = app.getContactHelper().getContacts();
		assertThat(newList, equalTo(oldList.withAdded(emptyDataContact)));
	}
}